<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="得闲技术 Team">
    <meta name="copyright" content="得闲技术">
    <title>登录日志列表 - Powered By 得闲技术</title>
    [#include "/admin/main/resources/list.ftl"/]
</head>
<body class="admin secondary">

<main>
    <div class="container-fluid">
        [#assign activeBreadcrumb= "登录日志"/]
        [#include  "/admin/main/breadcrumb.ftl"/]
        <form action="list" method="get">
            <div id="filterModal" class="modal fade" tabindex="-1" style="display: none;">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button class="close" type="button" data-dismiss="modal">×</button>
                            <h5 class="modal-title">更多选项</h5>
                        </div>
                        <div class="modal-body form-horizontal">

                            <div class="form-group">
                                <label class="col-xs-2 control-label">设置:</label>
                                <div class="col-xs-10 col-sm-8">
                                    <div class="checkbox checkbox-inline">
                                        <input id="isSuccess_1" name="isSuccess" type="checkbox" value="true"
                                                [#if form?? && form.isSuccess?? && form.isSuccess]checked[/#if]>
                                        <label for="isSuccess_1">登录成功</label>
                                    </div>
                                    <div class="checkbox checkbox-inline">
                                        <input id="isSuccess_2" name="isSuccess" type="checkbox" value="false"
                                                [#if form?? && form.isSuccess?? && !form.isSuccess]checked[/#if]>
                                        <label for="isSuccess_2">登录失败</label>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-xs-2 control-label">操作IP:</label>
                                <div class="col-xs-10 col-sm-8">
                                    <input id="ip" name="ip" class="form-control" type="text" value="${form.ip!}" />
                                </div>
                            </div>
                            [#include "/admin/main/resources/date_filter.ftl" /]
                        </div>
                        <div class="modal-footer">
                            <button class="btn btn-primary" type="submit">确 定</button>
                            <button class="btn btn-default reset-all" type="button">重 置</button>
                            <button class="btn btn-default" type="button" data-dismiss="modal">取 消</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row">
                        <div class="col-xs-12 col-sm-7">
                            <div class="btn-group">
                                [@hasPermission name="loginLog:delete" ]
                                <button class="btn btn-default" type="button" data-action="delete" disabled>
                                    <i class="iconfont icon-close"></i>删除
                                </button>
                                [/@hasPermission]
                                <button class="btn btn-default" type="button" data-action="refresh">
                                    <i class="iconfont icon-refresh"></i>刷新
                                </button>
                                <button class="btn btn-default" type="button" data-toggle="modal"
                                        data-target="#filterModal">高级搜索
                                </button>
                                [#include "/admin/main/list/page_select.ftl" /]
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-5">
                            <div id="search" class="input-group">
                                <div class="input-group-btn">
                                    <button class="btn btn-default" type="button" data-toggle="dropdown">
                                        <span class="search-span">用户名</span>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li data-search-property="username">
                                            <a href="javascript:;">用户名</a>
                                        </li>
                                    </ul>
                                </div>
                                <input name="searchValue" class="form-control" type="text"
                                        value="${form.searchValue}" placeholder="搜 索"
                                        x-webkit-speech="x-webkit-speech" x-webkit-grammar="builtin:search">
                                <div class="input-group-btn">
                                    <button class="btn btn-default" type="submit">
                                        <i class="iconfont icon-search"></i>
                                        <span class="text-danger">[#if page??]${page.total!0}[#else]0[/#if]</span> 条
                                        /
                                        <span class="text-danger">${page.totalPages!0}</span>页</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel-body padding-10">
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th>
                                    <div class="checkbox">
                                        <input type="checkbox" data-toggle="checkAll">
                                        <label></label>
                                    </div>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="browser">
                                        浏览器
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    浏览器版本
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="osName">
                                        操作系统
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    设备类型
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="username">
                                        用户名
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    登录的IP
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="isSuccess">
                                        是否成功
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    可删除时间
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="createDate">
                                        创建时间
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            [#list page.content as content]
                                <tr>
                                    <td>
                                        <div class="checkbox">
                                            <input name="ids" type="checkbox" value="${content.id}"
                                                    [#if !content.isAllowedDelete]disabled[/#if]><label></label>
                                        </div>
                                    </td>
                                    <td>
                                        ${content.browser}
                                    </td>
                                    <td>
                                        ${content.browserVersion}
                                    </td>
                                    <td>
                                        ${content.osName}
                                    </td>
                                    <td>
                                        ${content.deviceType}
                                    </td>
                                    <td>
                                        ${content.username}
                                    </td>
                                    <td>
                                        <a href="https://www.ip138.com/iplookup.asp?ip=${content.ip}&action=2"
                                                target="_blank" title="查看IP归属地" data-toggle="tooltip">
                                            ${content.ip}
                                        </a>
                                    </td>
                                    <td>
                                        [#if content.isSuccess]
                                            <i class="text-green iconfont icon-check"></i>
                                        [#else]
                                            <i class="text-danger iconfont icon-close"></i>
                                        [/#if]
                                    </td>
                                    <td>
                                        ${content.canDeleteDate}
                                    </td>
                                    <td>
                                        <span title="${(content.createDate?string(" yyyy-MM-dd HH:mm:ss"))!}"
                                                data-toggle="tooltip">${(content.createDate?string("yyyy-MM-dd"))!}</span>
                                    </td>
                                    <td>

                                        [@hasPermission name="loginLog:update" ]
                                            <a class="btn btn-default btn-xs btn-icon" href="update?id=${content.id}"
                                                    data-redirect-url="list">
                                                <i class="iconfont icon-search"></i> 详情
                                            </a>
                                        [/@hasPermission]
                                    </td>
                                </tr>
                            [/#list]
                            </tbody>
                        </table>
                    </div>
                </div>
                [@pagination pageNumber=page.pageNumber totalPages = page.totalPages]
                    [#include "/admin/main/list/pagination.ftl" /]
                [/@pagination]
            </div>
        </form>
    </div>
</main>
</body>
</html>
